
// source idl: com.erp.company.dao.idl.CompanyDao.java

#ifndef COMPANYDAO_STUB_4_APP_H
#define COMPANYDAO_STUB_4_APP_H

#include <string>
#include <sstream>
#include "app_platform/cmd_obj.h"
#include "c2cent/base/basestub4app.h"
#include "app_platform/cntl_info.h"
#include "app_platform/intf_serializable.h"
#include "app_platform/intf_service_object.h"
#include <set>	
#include "erp/company/ddo/companyinfoddo_company.h"	
#include <map>	
#include "erp/company/ddo/companyfilterddo_company.h"	
#include <vector>	
#include "intf_companydao.h"

namespace erp
{
namespace company
{
namespace dao
{
	#define COMPANYDAO_STUB4APP_VERSION "ERP_COMPANY_DAO___COMPANYDAO__STUB4APP_VERSION__1.0 2013-10-25 10:16:19"
    const std::string COMPANYDAO_STUB4APP_NOUSE = COMPANYDAO_STUB4APP_VERSION;

	const uint32_t COMPANYDAO_ADDANDUPDATECOMPANY_REQ_CMD_ID = 0xc0661803; /// 请求命令号
	const uint32_t COMPANYDAO_ADDANDUPDATECOMPANY_RESP_CMD_ID = 0xc0668803; /// 回应命令号
	

	const uint32_t COMPANYDAO_DELETECOMPANY_REQ_CMD_ID = 0xc0661804; /// 请求命令号
	const uint32_t COMPANYDAO_DELETECOMPANY_RESP_CMD_ID = 0xc0668804; /// 回应命令号
	

	const uint32_t COMPANYDAO_GETCOMPANY_REQ_CMD_ID = 0xc0661802; /// 请求命令号
	const uint32_t COMPANYDAO_GETCOMPANY_RESP_CMD_ID = 0xc0668802; /// 回应命令号
	

	const uint32_t COMPANYDAO_GETCOMPANYBYIDS_REQ_CMD_ID = 0xc0661801; /// 请求命令号
	const uint32_t COMPANYDAO_GETCOMPANYBYIDS_RESP_CMD_ID = 0xc0668801; /// 回应命令号
	


	const uint16_t COMPANYDAO_MAX_PROTOCAL_VERSION = 2; //>平台支持的最大协议版本号

///////////////////////////// STRUCTS /////////////////////////////////////////////////
	/**
	 *
 	 * 
	 *
	 *
 	 * @date 2013-10-25 10:16:19
 	 * @version 0
	 */	
	struct CAddAndUpdateCompanyReq : public IServiceObject, public ISerializableXML
	{
		std::string machineKey;
		std::string source;
		uint32_t sceneId;
		erp::company::ddo::CCompanyInfoDdo companyInfo;
		std::string inReserve;
		std::string errmsg;
		std::string outReserve;
		
	    virtual uint32_t getCmdId() const { return COMPANYDAO_ADDANDUPDATECOMPANY_REQ_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
			//检查协议的版本号
		    //if(bs.getVersion() > COMPANYDAO_MAX_PROTOCAL_VERSION)
		    //return false;
			bs & machineKey;
			bs & source;
			bs & sceneId;
			companyInfo.Serialize(bs);
			bs & inReserve;
		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	
	/**
	 *
 	 * 
	 *
 	 * @date 2013-10-25 10:16:19
 	 * @version 0
	 */	
	struct CAddAndUpdateCompanyResp : public IServiceObject, public ISerializableXML
	{
		uint32_t dwResult;
		std::string errmsg;
		std::string outReserve;
	
	    virtual uint32_t getCmdId() const { return COMPANYDAO_ADDANDUPDATECOMPANY_RESP_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
		    bs & dwResult;
			bs & errmsg;
			bs & outReserve;
		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	/**
	 *
 	 * 
	 *
	 *
 	 * @date 2013-10-25 10:16:19
 	 * @version 0
	 */	
	struct CDeleteCompanyReq : public IServiceObject, public ISerializableXML
	{
		std::string machineKey;
		std::string source;
		uint32_t sceneId;
		erp::company::ddo::CCompanyInfoDdo companyInfo;
		std::string inReserve;
		std::string errmsg;
		std::string outReserve;
		
	    virtual uint32_t getCmdId() const { return COMPANYDAO_DELETECOMPANY_REQ_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
			//检查协议的版本号
		    //if(bs.getVersion() > COMPANYDAO_MAX_PROTOCAL_VERSION)
		    //return false;
			bs & machineKey;
			bs & source;
			bs & sceneId;
			companyInfo.Serialize(bs);
			bs & inReserve;
		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	
	/**
	 *
 	 * 
	 *
 	 * @date 2013-10-25 10:16:19
 	 * @version 0
	 */	
	struct CDeleteCompanyResp : public IServiceObject, public ISerializableXML
	{
		uint32_t dwResult;
		std::string errmsg;
		std::string outReserve;
	
	    virtual uint32_t getCmdId() const { return COMPANYDAO_DELETECOMPANY_RESP_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
		    bs & dwResult;
			bs & errmsg;
			bs & outReserve;
		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	/**
	 *
 	 * 
	 *
	 *
 	 * @date 2013-10-25 10:16:19
 	 * @version 0
	 */	
	struct CGetCompanyReq : public IServiceObject, public ISerializableXML
	{
		std::string machineKey;
		std::string source;
		uint32_t sceneId;
		erp::company::ddo::CCompanyFilterDdo companyFilter;
		std::string inReserve;
		std::string errmsg;
		std::vector<erp::company::ddo::CCompanyInfoDdo > companyInfo;
		std::string outReserve;
		
	    virtual uint32_t getCmdId() const { return COMPANYDAO_GETCOMPANY_REQ_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
			//检查协议的版本号
		    //if(bs.getVersion() > COMPANYDAO_MAX_PROTOCAL_VERSION)
		    //return false;
			bs & machineKey;
			bs & source;
			bs & sceneId;
			companyFilter.Serialize(bs);
			bs & inReserve;
		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	
	/**
	 *
 	 * 
	 *
 	 * @date 2013-10-25 10:16:19
 	 * @version 0
	 */	
	struct CGetCompanyResp : public IServiceObject, public ISerializableXML
	{
		uint32_t dwResult;
		std::string errmsg;
		std::vector<erp::company::ddo::CCompanyInfoDdo > companyInfo;
		std::string outReserve;
	
	    virtual uint32_t getCmdId() const { return COMPANYDAO_GETCOMPANY_RESP_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
		    bs & dwResult;
			bs & errmsg;
			bs & companyInfo;
			bs & outReserve;
		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	/**
	 *
 	 * 
	 *
	 *
 	 * @date 2013-10-25 10:16:19
 	 * @version 0
	 */	
	struct CGetCompanyByIdsReq : public IServiceObject, public ISerializableXML
	{
		std::string machineKey;
		std::string source;
		uint32_t sceneId;
		std::set<uint32_t > companysysNoList;
		std::string inReserve;
		std::string errmsg;
		std::map<uint32_t,erp::company::ddo::CCompanyInfoDdo > companyInfo;
		std::string outReserve;
		
	    virtual uint32_t getCmdId() const { return COMPANYDAO_GETCOMPANYBYIDS_REQ_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
			//检查协议的版本号
		    //if(bs.getVersion() > COMPANYDAO_MAX_PROTOCAL_VERSION)
		    //return false;
			bs & machineKey;
			bs & source;
			bs & sceneId;
			bs & companysysNoList;
			bs & inReserve;
		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	
	/**
	 *
 	 * 
	 *
 	 * @date 2013-10-25 10:16:19
 	 * @version 0
	 */	
	struct CGetCompanyByIdsResp : public IServiceObject, public ISerializableXML
	{
		uint32_t dwResult;
		std::string errmsg;
		std::map<uint32_t,erp::company::ddo::CCompanyInfoDdo > companyInfo;
		std::string outReserve;
	
	    virtual uint32_t getCmdId() const { return COMPANYDAO_GETCOMPANYBYIDS_RESP_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
		    bs & dwResult;
			bs & errmsg;
			bs & companyInfo;
			bs & outReserve;
		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	class CCompanyDaoStub4App : public c2cent::CBaseStub4App, public ICompanyDao,public ICompanyDaoAsyc{
		public:
			uint32_t AddAndUpdateCompany(
				const CCntlInfo& rCntlInfo,
				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::company::ddo::CCompanyInfoDdo& companyInfo,
				const std::string& inReserve,
				std::string& errmsg,
				std::string& outReserve
			);
			
			uint32_t SendAddAndUpdateCompany(
				const CCntlInfo& rCntlInfo,
				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::company::ddo::CCompanyInfoDdo& companyInfo,
				const std::string& inReserve
		    );
		    uint32_t RecvAddAndUpdateCompany(
				const CCntlInfo& rCntlInfo,
				std::string& errmsg,
				std::string& outReserve
		    );
		    
		    uint32_t RecvAddAndUpdateCompany(
		  		CCmdObj& rCmd,
				std::string& errmsg,
				std::string& outReserve
		    );
		    
		    uint32_t GetAddAndUpdateCompanyRespCmd(
		    );
			uint32_t DeleteCompany(
				const CCntlInfo& rCntlInfo,
				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::company::ddo::CCompanyInfoDdo& companyInfo,
				const std::string& inReserve,
				std::string& errmsg,
				std::string& outReserve
			);
			
			uint32_t SendDeleteCompany(
				const CCntlInfo& rCntlInfo,
				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::company::ddo::CCompanyInfoDdo& companyInfo,
				const std::string& inReserve
		    );
		    uint32_t RecvDeleteCompany(
				const CCntlInfo& rCntlInfo,
				std::string& errmsg,
				std::string& outReserve
		    );
		    
		    uint32_t RecvDeleteCompany(
		  		CCmdObj& rCmd,
				std::string& errmsg,
				std::string& outReserve
		    );
		    
		    uint32_t GetDeleteCompanyRespCmd(
		    );
			uint32_t GetCompany(
				const CCntlInfo& rCntlInfo,
				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::company::ddo::CCompanyFilterDdo& companyFilter,
				const std::string& inReserve,
				std::string& errmsg,
				std::vector<erp::company::ddo::CCompanyInfoDdo >& companyInfo,
				std::string& outReserve
			);
			
			uint32_t SendGetCompany(
				const CCntlInfo& rCntlInfo,
				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::company::ddo::CCompanyFilterDdo& companyFilter,
				const std::string& inReserve
		    );
		    uint32_t RecvGetCompany(
				const CCntlInfo& rCntlInfo,
				std::string& errmsg,
				std::vector<erp::company::ddo::CCompanyInfoDdo >& companyInfo,
				std::string& outReserve
		    );
		    
		    uint32_t RecvGetCompany(
		  		CCmdObj& rCmd,
				std::string& errmsg,
				std::vector<erp::company::ddo::CCompanyInfoDdo >& companyInfo,
				std::string& outReserve
		    );
		    
		    uint32_t GetGetCompanyRespCmd(
		    );
			uint32_t GetCompanyByIds(
				const CCntlInfo& rCntlInfo,
				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const std::set<uint32_t >& companysysNoList,
				const std::string& inReserve,
				std::string& errmsg,
				std::map<uint32_t,erp::company::ddo::CCompanyInfoDdo >& companyInfo,
				std::string& outReserve
			);
			
			uint32_t SendGetCompanyByIds(
				const CCntlInfo& rCntlInfo,
				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const std::set<uint32_t >& companysysNoList,
				const std::string& inReserve
		    );
		    uint32_t RecvGetCompanyByIds(
				const CCntlInfo& rCntlInfo,
				std::string& errmsg,
				std::map<uint32_t,erp::company::ddo::CCompanyInfoDdo >& companyInfo,
				std::string& outReserve
		    );
		    
		    uint32_t RecvGetCompanyByIds(
		  		CCmdObj& rCmd,
				std::string& errmsg,
				std::map<uint32_t,erp::company::ddo::CCompanyInfoDdo >& companyInfo,
				std::string& outReserve
		    );
		    
		    uint32_t GetGetCompanyByIdsRespCmd(
		    );
	};
	
	/**
	 *
 	 *  写入&更新用户企业信息 
	 *
		 *@param String machineKey: 机器码，必填  				
		 *@param String source: 调用来源，必填  				
		 *@param uint32_t sceneId: 场景id，必填  				
		 *@param CompanyInfoDdo companyInfo: 员工信息列表，必填  				
		 *@param String inReserve: 请求保留字  				
		 *@param String errmsg: 错误信息  		
		 *@param String outReserve: 返回保留字   		
     *
     *@return uint32_t : 0(成功) 其它失败
	 */	
	inline uint32_t CCompanyDaoStub4App::AddAndUpdateCompany(
				const CCntlInfo& rCntlInfo,
				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::company::ddo::CCompanyInfoDdo& companyInfo,
				const std::string& inReserve,
				std::string& errmsg,
				std::string& outReserve
	)
	{
		CAddAndUpdateCompanyReq oReq;
			oReq.machineKey = machineKey;
			oReq.source = source;
			oReq.sceneId = sceneId;
			oReq.companyInfo = companyInfo;
			oReq.inReserve = inReserve;
			oReq.errmsg = errmsg;
			oReq.outReserve = outReserve;
	
		CCntlInfo* pCntlInfo = const_cast<CCntlInfo*>(&rCntlInfo);
	    m_pSvcCntl = reinterpret_cast<IServiceControl*>(pCntlInfo->getCntl());
	    if (m_pSvcCntl == NULL)
        {
            m_sErrMsg = "error, rCntlInfo is temporary variable";
            return 0xEE0041;
        }
	    int iRetCode = 0;
	    if((iRetCode = m_pSvcCntl->putSvcObj(&oReq, pCntlInfo->getRouteKey())) != 0)
	    {
	    	m_sErrMsg = "DoRequest failed.";
	        return iRetCode;
	    }
	
	    if((iRetCode = m_pSvcCntl->schedule()) != 0)
	    {
	        m_sErrMsg = "schedule failed.";
	        return 0xFFF2;
	    }
	    
	    CCmdObj& rCmd = m_pSvcCntl->getRespObj();
	    if(!rCmd.isValid(COMPANYDAO_ADDANDUPDATECOMPANY_RESP_CMD_ID))
	    {
	    	std::stringstream oss;
            oss << "Cmd not match: "
                << "expected cmd=" << std::hex << COMPANYDAO_ADDANDUPDATECOMPANY_RESP_CMD_ID << std::dec << " != "
                << "actualed cmd=" << std::hex << rCmd.getCmdId() << std::dec;
            m_sErrMsg = oss.str();
            return 0xEE0029;
	    }
	    
	    char* pBuf = NULL; uint32_t nLen = 0;
	    rCmd.getBuffer(pBuf, nLen);
	    CByteStreamNetwork bs(pBuf, nLen);
	    bs.isStoring(false);
	    
	    CAddAndUpdateCompanyResp oResp;
	    if(!oResp.Serialize(bs))
	    {
	        m_sErrMsg = "Resp.Serialize(bs) failed";
	        return 0xEE0030;
	    }
			errmsg  = oResp.errmsg;
			outReserve  = oResp.outReserve;
	    
	    return oResp.dwResult;
	}
	inline uint32_t CCompanyDaoStub4App::SendAddAndUpdateCompany(
				const CCntlInfo& rCntlInfo,
				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::company::ddo::CCompanyInfoDdo& companyInfo,
				const std::string& inReserve
	)
	{
	    CAddAndUpdateCompanyReq oReq;
			oReq.machineKey = machineKey;
			oReq.source = source;
			oReq.sceneId = sceneId;
			oReq.companyInfo = companyInfo;
			oReq.inReserve = inReserve;
	
		CCntlInfo* pCntlInfo = const_cast<CCntlInfo*>(&rCntlInfo);
	    m_pSvcCntl = reinterpret_cast<IServiceControl*>(pCntlInfo->getCntl());
	    if (m_pSvcCntl == NULL)
        {
            m_sErrMsg = "error, rCntlInfo is temporary variable";
            return 0xEE0041;
        }
	    int iRetCode = 0;
	    if((iRetCode = m_pSvcCntl->putSvcObj(&oReq, pCntlInfo->getRouteKey())) != 0)
	    {
	    	m_sErrMsg = "DoRequest failed.";
	        return iRetCode;
	    }
		return 0;
	}
	inline uint32_t CCompanyDaoStub4App::RecvAddAndUpdateCompany(
				const CCntlInfo& rCntlInfo,
				std::string& errmsg,
				std::string& outReserve
	)
	{
		CCntlInfo* pCntlInfo = const_cast<CCntlInfo*>(&rCntlInfo);
	    m_pSvcCntl = reinterpret_cast<IServiceControl*>(pCntlInfo->getCntl());
	    CCmdObj& rCmd = m_pSvcCntl->getRespObj();
	    if(!rCmd.isValid(COMPANYDAO_ADDANDUPDATECOMPANY_RESP_CMD_ID))
	    {
	    	std::stringstream oss;
            oss << "Cmd not match: "
                << "expected cmd=" << std::hex << COMPANYDAO_ADDANDUPDATECOMPANY_RESP_CMD_ID << std::dec << " != "
                << "actualed cmd=" << std::hex << rCmd.getCmdId() << std::dec;
            m_sErrMsg = oss.str();
	        return 0xEE0031;
	    }
	    
	    char* pBuf = NULL; uint32_t nLen = 0;
	    rCmd.getBuffer(pBuf, nLen);
	    CByteStreamNetwork bs(pBuf, nLen);
	    bs.isStoring(false);
	    
	    CAddAndUpdateCompanyResp oResp;
	    if(!oResp.Serialize(bs))
	    {
	        m_sErrMsg = "Resp.Serialize(bs) failed";
	        return 0xEE0032;
	    }
			errmsg  = oResp.errmsg;
			outReserve  = oResp.outReserve;
	    
	    return oResp.dwResult;
	}
	
	inline uint32_t CCompanyDaoStub4App::RecvAddAndUpdateCompany(
		  		CCmdObj& rCmd,
				std::string& errmsg,
				std::string& outReserve
	)
	{	    
	    char* pBuf = NULL; uint32_t nLen = 0;
	    rCmd.getBuffer(pBuf, nLen);
	    CByteStreamNetwork bs(pBuf, nLen);
	    bs.isStoring(false);
	    
	    CAddAndUpdateCompanyResp oResp;
	    if(!oResp.Serialize(bs))
	    {
	        m_sErrMsg = "Resp.Serialize(bs) failed";
	        return 0xEE0033;
	    }
			errmsg  = oResp.errmsg;
			outReserve  = oResp.outReserve;
	    
	    return oResp.dwResult;
	}
	
	inline uint32_t CCompanyDaoStub4App::GetAddAndUpdateCompanyRespCmd(
	)
	{	    
	    return COMPANYDAO_ADDANDUPDATECOMPANY_RESP_CMD_ID;
	}	
	/**
	 *
 	 *  逻辑删除用户企业信息 
	 *
		 *@param String machineKey: 机器码，必填  				
		 *@param String source: 调用来源，必填  				
		 *@param uint32_t sceneId: 场景id，必填  				
		 *@param CompanyInfoDdo companyInfo: 用户企业信息列表，必填  				
		 *@param String inReserve: 请求保留字  				
		 *@param String errmsg: 错误信息  		
		 *@param String outReserve: 返回保留字   		
     *
     *@return uint32_t : 0(成功) 其它失败
	 */	
	inline uint32_t CCompanyDaoStub4App::DeleteCompany(
				const CCntlInfo& rCntlInfo,
				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::company::ddo::CCompanyInfoDdo& companyInfo,
				const std::string& inReserve,
				std::string& errmsg,
				std::string& outReserve
	)
	{
		CDeleteCompanyReq oReq;
			oReq.machineKey = machineKey;
			oReq.source = source;
			oReq.sceneId = sceneId;
			oReq.companyInfo = companyInfo;
			oReq.inReserve = inReserve;
			oReq.errmsg = errmsg;
			oReq.outReserve = outReserve;
	
		CCntlInfo* pCntlInfo = const_cast<CCntlInfo*>(&rCntlInfo);
	    m_pSvcCntl = reinterpret_cast<IServiceControl*>(pCntlInfo->getCntl());
	    if (m_pSvcCntl == NULL)
        {
            m_sErrMsg = "error, rCntlInfo is temporary variable";
            return 0xEE0041;
        }
	    int iRetCode = 0;
	    if((iRetCode = m_pSvcCntl->putSvcObj(&oReq, pCntlInfo->getRouteKey())) != 0)
	    {
	    	m_sErrMsg = "DoRequest failed.";
	        return iRetCode;
	    }
	
	    if((iRetCode = m_pSvcCntl->schedule()) != 0)
	    {
	        m_sErrMsg = "schedule failed.";
	        return 0xFFF2;
	    }
	    
	    CCmdObj& rCmd = m_pSvcCntl->getRespObj();
	    if(!rCmd.isValid(COMPANYDAO_DELETECOMPANY_RESP_CMD_ID))
	    {
	    	std::stringstream oss;
            oss << "Cmd not match: "
                << "expected cmd=" << std::hex << COMPANYDAO_DELETECOMPANY_RESP_CMD_ID << std::dec << " != "
                << "actualed cmd=" << std::hex << rCmd.getCmdId() << std::dec;
            m_sErrMsg = oss.str();
            return 0xEE0029;
	    }
	    
	    char* pBuf = NULL; uint32_t nLen = 0;
	    rCmd.getBuffer(pBuf, nLen);
	    CByteStreamNetwork bs(pBuf, nLen);
	    bs.isStoring(false);
	    
	    CDeleteCompanyResp oResp;
	    if(!oResp.Serialize(bs))
	    {
	        m_sErrMsg = "Resp.Serialize(bs) failed";
	        return 0xEE0030;
	    }
			errmsg  = oResp.errmsg;
			outReserve  = oResp.outReserve;
	    
	    return oResp.dwResult;
	}
	inline uint32_t CCompanyDaoStub4App::SendDeleteCompany(
				const CCntlInfo& rCntlInfo,
				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::company::ddo::CCompanyInfoDdo& companyInfo,
				const std::string& inReserve
	)
	{
	    CDeleteCompanyReq oReq;
			oReq.machineKey = machineKey;
			oReq.source = source;
			oReq.sceneId = sceneId;
			oReq.companyInfo = companyInfo;
			oReq.inReserve = inReserve;
	
		CCntlInfo* pCntlInfo = const_cast<CCntlInfo*>(&rCntlInfo);
	    m_pSvcCntl = reinterpret_cast<IServiceControl*>(pCntlInfo->getCntl());
	    if (m_pSvcCntl == NULL)
        {
            m_sErrMsg = "error, rCntlInfo is temporary variable";
            return 0xEE0041;
        }
	    int iRetCode = 0;
	    if((iRetCode = m_pSvcCntl->putSvcObj(&oReq, pCntlInfo->getRouteKey())) != 0)
	    {
	    	m_sErrMsg = "DoRequest failed.";
	        return iRetCode;
	    }
		return 0;
	}
	inline uint32_t CCompanyDaoStub4App::RecvDeleteCompany(
				const CCntlInfo& rCntlInfo,
				std::string& errmsg,
				std::string& outReserve
	)
	{
		CCntlInfo* pCntlInfo = const_cast<CCntlInfo*>(&rCntlInfo);
	    m_pSvcCntl = reinterpret_cast<IServiceControl*>(pCntlInfo->getCntl());
	    CCmdObj& rCmd = m_pSvcCntl->getRespObj();
	    if(!rCmd.isValid(COMPANYDAO_DELETECOMPANY_RESP_CMD_ID))
	    {
	    	std::stringstream oss;
            oss << "Cmd not match: "
                << "expected cmd=" << std::hex << COMPANYDAO_DELETECOMPANY_RESP_CMD_ID << std::dec << " != "
                << "actualed cmd=" << std::hex << rCmd.getCmdId() << std::dec;
            m_sErrMsg = oss.str();
	        return 0xEE0031;
	    }
	    
	    char* pBuf = NULL; uint32_t nLen = 0;
	    rCmd.getBuffer(pBuf, nLen);
	    CByteStreamNetwork bs(pBuf, nLen);
	    bs.isStoring(false);
	    
	    CDeleteCompanyResp oResp;
	    if(!oResp.Serialize(bs))
	    {
	        m_sErrMsg = "Resp.Serialize(bs) failed";
	        return 0xEE0032;
	    }
			errmsg  = oResp.errmsg;
			outReserve  = oResp.outReserve;
	    
	    return oResp.dwResult;
	}
	
	inline uint32_t CCompanyDaoStub4App::RecvDeleteCompany(
		  		CCmdObj& rCmd,
				std::string& errmsg,
				std::string& outReserve
	)
	{	    
	    char* pBuf = NULL; uint32_t nLen = 0;
	    rCmd.getBuffer(pBuf, nLen);
	    CByteStreamNetwork bs(pBuf, nLen);
	    bs.isStoring(false);
	    
	    CDeleteCompanyResp oResp;
	    if(!oResp.Serialize(bs))
	    {
	        m_sErrMsg = "Resp.Serialize(bs) failed";
	        return 0xEE0033;
	    }
			errmsg  = oResp.errmsg;
			outReserve  = oResp.outReserve;
	    
	    return oResp.dwResult;
	}
	
	inline uint32_t CCompanyDaoStub4App::GetDeleteCompanyRespCmd(
	)
	{	    
	    return COMPANYDAO_DELETECOMPANY_RESP_CMD_ID;
	}	
	/**
	 *
 	 *  获取银行账户信息 
	 *
		 *@param String machineKey: 机器码，必填  				
		 *@param String source: 调用来源，必填  				
		 *@param uint32_t sceneId: 场景id，必填  				
		 *@param CompanyFilterDdo companyFilter: 过滤器，必填  				
		 *@param String inReserve: 请求保留字  				
		 *@param String errmsg: 错误信息  		
		 *@param Vector companyInfo: 员工信息  		
		 *@param String outReserve: 返回保留字   		
     *
     *@return uint32_t : 0(成功) 其它失败
	 */	
	inline uint32_t CCompanyDaoStub4App::GetCompany(
				const CCntlInfo& rCntlInfo,
				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::company::ddo::CCompanyFilterDdo& companyFilter,
				const std::string& inReserve,
				std::string& errmsg,
				std::vector<erp::company::ddo::CCompanyInfoDdo >& companyInfo,
				std::string& outReserve
	)
	{
		CGetCompanyReq oReq;
			oReq.machineKey = machineKey;
			oReq.source = source;
			oReq.sceneId = sceneId;
			oReq.companyFilter = companyFilter;
			oReq.inReserve = inReserve;
			oReq.errmsg = errmsg;
			oReq.companyInfo = companyInfo;
			oReq.outReserve = outReserve;
	
		CCntlInfo* pCntlInfo = const_cast<CCntlInfo*>(&rCntlInfo);
	    m_pSvcCntl = reinterpret_cast<IServiceControl*>(pCntlInfo->getCntl());
	    if (m_pSvcCntl == NULL)
        {
            m_sErrMsg = "error, rCntlInfo is temporary variable";
            return 0xEE0041;
        }
	    int iRetCode = 0;
	    if((iRetCode = m_pSvcCntl->putSvcObj(&oReq, pCntlInfo->getRouteKey())) != 0)
	    {
	    	m_sErrMsg = "DoRequest failed.";
	        return iRetCode;
	    }
	
	    if((iRetCode = m_pSvcCntl->schedule()) != 0)
	    {
	        m_sErrMsg = "schedule failed.";
	        return 0xFFF2;
	    }
	    
	    CCmdObj& rCmd = m_pSvcCntl->getRespObj();
	    if(!rCmd.isValid(COMPANYDAO_GETCOMPANY_RESP_CMD_ID))
	    {
	    	std::stringstream oss;
            oss << "Cmd not match: "
                << "expected cmd=" << std::hex << COMPANYDAO_GETCOMPANY_RESP_CMD_ID << std::dec << " != "
                << "actualed cmd=" << std::hex << rCmd.getCmdId() << std::dec;
            m_sErrMsg = oss.str();
            return 0xEE0029;
	    }
	    
	    char* pBuf = NULL; uint32_t nLen = 0;
	    rCmd.getBuffer(pBuf, nLen);
	    CByteStreamNetwork bs(pBuf, nLen);
	    bs.isStoring(false);
	    
	    CGetCompanyResp oResp;
	    if(!oResp.Serialize(bs))
	    {
	        m_sErrMsg = "Resp.Serialize(bs) failed";
	        return 0xEE0030;
	    }
			errmsg  = oResp.errmsg;
			companyInfo  = oResp.companyInfo;
			outReserve  = oResp.outReserve;
	    
	    return oResp.dwResult;
	}
	inline uint32_t CCompanyDaoStub4App::SendGetCompany(
				const CCntlInfo& rCntlInfo,
				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::company::ddo::CCompanyFilterDdo& companyFilter,
				const std::string& inReserve
	)
	{
	    CGetCompanyReq oReq;
			oReq.machineKey = machineKey;
			oReq.source = source;
			oReq.sceneId = sceneId;
			oReq.companyFilter = companyFilter;
			oReq.inReserve = inReserve;
	
		CCntlInfo* pCntlInfo = const_cast<CCntlInfo*>(&rCntlInfo);
	    m_pSvcCntl = reinterpret_cast<IServiceControl*>(pCntlInfo->getCntl());
	    if (m_pSvcCntl == NULL)
        {
            m_sErrMsg = "error, rCntlInfo is temporary variable";
            return 0xEE0041;
        }
	    int iRetCode = 0;
	    if((iRetCode = m_pSvcCntl->putSvcObj(&oReq, pCntlInfo->getRouteKey())) != 0)
	    {
	    	m_sErrMsg = "DoRequest failed.";
	        return iRetCode;
	    }
		return 0;
	}
	inline uint32_t CCompanyDaoStub4App::RecvGetCompany(
				const CCntlInfo& rCntlInfo,
				std::string& errmsg,
				std::vector<erp::company::ddo::CCompanyInfoDdo >& companyInfo,
				std::string& outReserve
	)
	{
		CCntlInfo* pCntlInfo = const_cast<CCntlInfo*>(&rCntlInfo);
	    m_pSvcCntl = reinterpret_cast<IServiceControl*>(pCntlInfo->getCntl());
	    CCmdObj& rCmd = m_pSvcCntl->getRespObj();
	    if(!rCmd.isValid(COMPANYDAO_GETCOMPANY_RESP_CMD_ID))
	    {
	    	std::stringstream oss;
            oss << "Cmd not match: "
                << "expected cmd=" << std::hex << COMPANYDAO_GETCOMPANY_RESP_CMD_ID << std::dec << " != "
                << "actualed cmd=" << std::hex << rCmd.getCmdId() << std::dec;
            m_sErrMsg = oss.str();
	        return 0xEE0031;
	    }
	    
	    char* pBuf = NULL; uint32_t nLen = 0;
	    rCmd.getBuffer(pBuf, nLen);
	    CByteStreamNetwork bs(pBuf, nLen);
	    bs.isStoring(false);
	    
	    CGetCompanyResp oResp;
	    if(!oResp.Serialize(bs))
	    {
	        m_sErrMsg = "Resp.Serialize(bs) failed";
	        return 0xEE0032;
	    }
			errmsg  = oResp.errmsg;
			companyInfo  = oResp.companyInfo;
			outReserve  = oResp.outReserve;
	    
	    return oResp.dwResult;
	}
	
	inline uint32_t CCompanyDaoStub4App::RecvGetCompany(
		  		CCmdObj& rCmd,
				std::string& errmsg,
				std::vector<erp::company::ddo::CCompanyInfoDdo >& companyInfo,
				std::string& outReserve
	)
	{	    
	    char* pBuf = NULL; uint32_t nLen = 0;
	    rCmd.getBuffer(pBuf, nLen);
	    CByteStreamNetwork bs(pBuf, nLen);
	    bs.isStoring(false);
	    
	    CGetCompanyResp oResp;
	    if(!oResp.Serialize(bs))
	    {
	        m_sErrMsg = "Resp.Serialize(bs) failed";
	        return 0xEE0033;
	    }
			errmsg  = oResp.errmsg;
			companyInfo  = oResp.companyInfo;
			outReserve  = oResp.outReserve;
	    
	    return oResp.dwResult;
	}
	
	inline uint32_t CCompanyDaoStub4App::GetGetCompanyRespCmd(
	)
	{	    
	    return COMPANYDAO_GETCOMPANY_RESP_CMD_ID;
	}	
	/**
	 *
 	 *  通过SysNos获取用户企业信息 
	 *
		 *@param String machineKey: 机器码，必填  				
		 *@param String source: 调用来源，必填  				
		 *@param uint32_t sceneId: 场景id，必填  				
		 *@param Set companysysNoList: 用户企业SysNo数组，必填  				
		 *@param String inReserve: 请求保留字  				
		 *@param String errmsg: 错误信息  		
		 *@param Map companyInfo: 员工信息  		
		 *@param String outReserve: 返回保留字   		
     *
     *@return uint32_t : 0(成功) 其它失败
	 */	
	inline uint32_t CCompanyDaoStub4App::GetCompanyByIds(
				const CCntlInfo& rCntlInfo,
				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const std::set<uint32_t >& companysysNoList,
				const std::string& inReserve,
				std::string& errmsg,
				std::map<uint32_t,erp::company::ddo::CCompanyInfoDdo >& companyInfo,
				std::string& outReserve
	)
	{
		CGetCompanyByIdsReq oReq;
			oReq.machineKey = machineKey;
			oReq.source = source;
			oReq.sceneId = sceneId;
			oReq.companysysNoList = companysysNoList;
			oReq.inReserve = inReserve;
			oReq.errmsg = errmsg;
			oReq.companyInfo = companyInfo;
			oReq.outReserve = outReserve;
	
		CCntlInfo* pCntlInfo = const_cast<CCntlInfo*>(&rCntlInfo);
	    m_pSvcCntl = reinterpret_cast<IServiceControl*>(pCntlInfo->getCntl());
	    if (m_pSvcCntl == NULL)
        {
            m_sErrMsg = "error, rCntlInfo is temporary variable";
            return 0xEE0041;
        }
	    int iRetCode = 0;
	    if((iRetCode = m_pSvcCntl->putSvcObj(&oReq, pCntlInfo->getRouteKey())) != 0)
	    {
	    	m_sErrMsg = "DoRequest failed.";
	        return iRetCode;
	    }
	
	    if((iRetCode = m_pSvcCntl->schedule()) != 0)
	    {
	        m_sErrMsg = "schedule failed.";
	        return 0xFFF2;
	    }
	    
	    CCmdObj& rCmd = m_pSvcCntl->getRespObj();
	    if(!rCmd.isValid(COMPANYDAO_GETCOMPANYBYIDS_RESP_CMD_ID))
	    {
	    	std::stringstream oss;
            oss << "Cmd not match: "
                << "expected cmd=" << std::hex << COMPANYDAO_GETCOMPANYBYIDS_RESP_CMD_ID << std::dec << " != "
                << "actualed cmd=" << std::hex << rCmd.getCmdId() << std::dec;
            m_sErrMsg = oss.str();
            return 0xEE0029;
	    }
	    
	    char* pBuf = NULL; uint32_t nLen = 0;
	    rCmd.getBuffer(pBuf, nLen);
	    CByteStreamNetwork bs(pBuf, nLen);
	    bs.isStoring(false);
	    
	    CGetCompanyByIdsResp oResp;
	    if(!oResp.Serialize(bs))
	    {
	        m_sErrMsg = "Resp.Serialize(bs) failed";
	        return 0xEE0030;
	    }
			errmsg  = oResp.errmsg;
			companyInfo  = oResp.companyInfo;
			outReserve  = oResp.outReserve;
	    
	    return oResp.dwResult;
	}
	inline uint32_t CCompanyDaoStub4App::SendGetCompanyByIds(
				const CCntlInfo& rCntlInfo,
				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const std::set<uint32_t >& companysysNoList,
				const std::string& inReserve
	)
	{
	    CGetCompanyByIdsReq oReq;
			oReq.machineKey = machineKey;
			oReq.source = source;
			oReq.sceneId = sceneId;
			oReq.companysysNoList = companysysNoList;
			oReq.inReserve = inReserve;
	
		CCntlInfo* pCntlInfo = const_cast<CCntlInfo*>(&rCntlInfo);
	    m_pSvcCntl = reinterpret_cast<IServiceControl*>(pCntlInfo->getCntl());
	    if (m_pSvcCntl == NULL)
        {
            m_sErrMsg = "error, rCntlInfo is temporary variable";
            return 0xEE0041;
        }
	    int iRetCode = 0;
	    if((iRetCode = m_pSvcCntl->putSvcObj(&oReq, pCntlInfo->getRouteKey())) != 0)
	    {
	    	m_sErrMsg = "DoRequest failed.";
	        return iRetCode;
	    }
		return 0;
	}
	inline uint32_t CCompanyDaoStub4App::RecvGetCompanyByIds(
				const CCntlInfo& rCntlInfo,
				std::string& errmsg,
				std::map<uint32_t,erp::company::ddo::CCompanyInfoDdo >& companyInfo,
				std::string& outReserve
	)
	{
		CCntlInfo* pCntlInfo = const_cast<CCntlInfo*>(&rCntlInfo);
	    m_pSvcCntl = reinterpret_cast<IServiceControl*>(pCntlInfo->getCntl());
	    CCmdObj& rCmd = m_pSvcCntl->getRespObj();
	    if(!rCmd.isValid(COMPANYDAO_GETCOMPANYBYIDS_RESP_CMD_ID))
	    {
	    	std::stringstream oss;
            oss << "Cmd not match: "
                << "expected cmd=" << std::hex << COMPANYDAO_GETCOMPANYBYIDS_RESP_CMD_ID << std::dec << " != "
                << "actualed cmd=" << std::hex << rCmd.getCmdId() << std::dec;
            m_sErrMsg = oss.str();
	        return 0xEE0031;
	    }
	    
	    char* pBuf = NULL; uint32_t nLen = 0;
	    rCmd.getBuffer(pBuf, nLen);
	    CByteStreamNetwork bs(pBuf, nLen);
	    bs.isStoring(false);
	    
	    CGetCompanyByIdsResp oResp;
	    if(!oResp.Serialize(bs))
	    {
	        m_sErrMsg = "Resp.Serialize(bs) failed";
	        return 0xEE0032;
	    }
			errmsg  = oResp.errmsg;
			companyInfo  = oResp.companyInfo;
			outReserve  = oResp.outReserve;
	    
	    return oResp.dwResult;
	}
	
	inline uint32_t CCompanyDaoStub4App::RecvGetCompanyByIds(
		  		CCmdObj& rCmd,
				std::string& errmsg,
				std::map<uint32_t,erp::company::ddo::CCompanyInfoDdo >& companyInfo,
				std::string& outReserve
	)
	{	    
	    char* pBuf = NULL; uint32_t nLen = 0;
	    rCmd.getBuffer(pBuf, nLen);
	    CByteStreamNetwork bs(pBuf, nLen);
	    bs.isStoring(false);
	    
	    CGetCompanyByIdsResp oResp;
	    if(!oResp.Serialize(bs))
	    {
	        m_sErrMsg = "Resp.Serialize(bs) failed";
	        return 0xEE0033;
	    }
			errmsg  = oResp.errmsg;
			companyInfo  = oResp.companyInfo;
			outReserve  = oResp.outReserve;
	    
	    return oResp.dwResult;
	}
	
	inline uint32_t CCompanyDaoStub4App::GetGetCompanyByIdsRespCmd(
	)
	{	    
	    return COMPANYDAO_GETCOMPANYBYIDS_RESP_CMD_ID;
	}	
		
}
}
}

#endif /* COMPANYDAO_STUB_4_APP_H */
